﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace PasteLoggerBoard.EntityFrameworkCore.Migrations
{
    public partial class add_client_column : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.RenameColumn(
                name: "ClientIP",
                table: "PTLogWarning",
                newName: "ClientIp");

            migrationBuilder.AlterColumn<string>(
                name: "RequestId",
                table: "PTLogWarning",
                type: "character varying(32)",
                maxLength: 32,
                nullable: true,
                oldClrType: typeof(string),
                oldType: "character varying(64)",
                oldMaxLength: 64,
                oldNullable: true);

            migrationBuilder.AlterColumn<string>(
                name: "MessageTemplate",
                table: "PTLogWarning",
                type: "character varying(256)",
                maxLength: 256,
                nullable: true,
                oldClrType: typeof(string),
                oldType: "text",
                oldNullable: true);

            migrationBuilder.AlterColumn<string>(
                name: "ConnectionId",
                table: "PTLogWarning",
                type: "character varying(32)",
                maxLength: 32,
                nullable: true,
                oldClrType: typeof(string),
                oldType: "character varying(64)",
                oldMaxLength: 64,
                oldNullable: true);

            migrationBuilder.AddColumn<string>(
                name: "ClientIP",
                table: "PTLogWarning",
                type: "character varying(32)",
                maxLength: 32,
                nullable: true);

            migrationBuilder.AddColumn<double>(
                name: "ElapsedMilliseconds",
                table: "PTLogWarning",
                type: "double precision",
                nullable: false,
                defaultValue: 0.0);

            migrationBuilder.AddColumn<int>(
                name: "StatusCode",
                table: "PTLogWarning",
                type: "integer",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AlterColumn<string>(
                name: "MessageTemplate",
                table: "PTLogInfo",
                type: "character varying(256)",
                maxLength: 256,
                nullable: true,
                oldClrType: typeof(string),
                oldType: "text",
                oldNullable: true);

            migrationBuilder.AddColumn<string>(
                name: "ClientIp",
                table: "PTLogInfo",
                type: "character varying(32)",
                maxLength: 32,
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "ConnectionId",
                table: "PTLogInfo",
                type: "character varying(32)",
                maxLength: 32,
                nullable: true);

            migrationBuilder.AddColumn<double>(
                name: "ElapsedMilliseconds",
                table: "PTLogInfo",
                type: "double precision",
                nullable: false,
                defaultValue: 0.0);

            migrationBuilder.AddColumn<string>(
                name: "Path",
                table: "PTLogInfo",
                type: "character varying(128)",
                maxLength: 128,
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "RequestId",
                table: "PTLogInfo",
                type: "character varying(32)",
                maxLength: 32,
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "StatusCode",
                table: "PTLogInfo",
                type: "integer",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AlterColumn<string>(
                name: "MessageTemplate",
                table: "PTLogException",
                type: "character varying(256)",
                maxLength: 256,
                nullable: true,
                oldClrType: typeof(string),
                oldType: "text",
                oldNullable: true);

            migrationBuilder.AddColumn<string>(
                name: "ClientIp",
                table: "PTLogException",
                type: "character varying(32)",
                maxLength: 32,
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "ConnectionId",
                table: "PTLogException",
                type: "character varying(32)",
                maxLength: 32,
                nullable: true);

            migrationBuilder.AddColumn<double>(
                name: "ElapsedMilliseconds",
                table: "PTLogException",
                type: "double precision",
                nullable: false,
                defaultValue: 0.0);

            migrationBuilder.AddColumn<string>(
                name: "Path",
                table: "PTLogException",
                type: "character varying(128)",
                maxLength: 128,
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "RequestId",
                table: "PTLogException",
                type: "character varying(32)",
                maxLength: 32,
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "StatusCode",
                table: "PTLogException",
                type: "integer",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AlterColumn<string>(
                name: "MessageTemplate",
                table: "PTLogError",
                type: "character varying(256)",
                maxLength: 256,
                nullable: true,
                oldClrType: typeof(string),
                oldType: "text",
                oldNullable: true);

            migrationBuilder.AddColumn<string>(
                name: "ClientIp",
                table: "PTLogError",
                type: "character varying(32)",
                maxLength: 32,
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "ConnectionId",
                table: "PTLogError",
                type: "character varying(32)",
                maxLength: 32,
                nullable: true);

            migrationBuilder.AddColumn<double>(
                name: "ElapsedMilliseconds",
                table: "PTLogError",
                type: "double precision",
                nullable: false,
                defaultValue: 0.0);

            migrationBuilder.AddColumn<string>(
                name: "Path",
                table: "PTLogError",
                type: "character varying(128)",
                maxLength: 128,
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "RequestId",
                table: "PTLogError",
                type: "character varying(32)",
                maxLength: 32,
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "StatusCode",
                table: "PTLogError",
                type: "integer",
                nullable: false,
                defaultValue: 0);
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "ClientIP",
                table: "PTLogWarning");

            migrationBuilder.DropColumn(
                name: "ElapsedMilliseconds",
                table: "PTLogWarning");

            migrationBuilder.DropColumn(
                name: "StatusCode",
                table: "PTLogWarning");

            migrationBuilder.DropColumn(
                name: "ClientIp",
                table: "PTLogInfo");

            migrationBuilder.DropColumn(
                name: "ConnectionId",
                table: "PTLogInfo");

            migrationBuilder.DropColumn(
                name: "ElapsedMilliseconds",
                table: "PTLogInfo");

            migrationBuilder.DropColumn(
                name: "Path",
                table: "PTLogInfo");

            migrationBuilder.DropColumn(
                name: "RequestId",
                table: "PTLogInfo");

            migrationBuilder.DropColumn(
                name: "StatusCode",
                table: "PTLogInfo");

            migrationBuilder.DropColumn(
                name: "ClientIp",
                table: "PTLogException");

            migrationBuilder.DropColumn(
                name: "ConnectionId",
                table: "PTLogException");

            migrationBuilder.DropColumn(
                name: "ElapsedMilliseconds",
                table: "PTLogException");

            migrationBuilder.DropColumn(
                name: "Path",
                table: "PTLogException");

            migrationBuilder.DropColumn(
                name: "RequestId",
                table: "PTLogException");

            migrationBuilder.DropColumn(
                name: "StatusCode",
                table: "PTLogException");

            migrationBuilder.DropColumn(
                name: "ClientIp",
                table: "PTLogError");

            migrationBuilder.DropColumn(
                name: "ConnectionId",
                table: "PTLogError");

            migrationBuilder.DropColumn(
                name: "ElapsedMilliseconds",
                table: "PTLogError");

            migrationBuilder.DropColumn(
                name: "Path",
                table: "PTLogError");

            migrationBuilder.DropColumn(
                name: "RequestId",
                table: "PTLogError");

            migrationBuilder.DropColumn(
                name: "StatusCode",
                table: "PTLogError");

            migrationBuilder.RenameColumn(
                name: "ClientIp",
                table: "PTLogWarning",
                newName: "ClientIP");

            migrationBuilder.AlterColumn<string>(
                name: "RequestId",
                table: "PTLogWarning",
                type: "character varying(64)",
                maxLength: 64,
                nullable: true,
                oldClrType: typeof(string),
                oldType: "character varying(32)",
                oldMaxLength: 32,
                oldNullable: true);

            migrationBuilder.AlterColumn<string>(
                name: "MessageTemplate",
                table: "PTLogWarning",
                type: "text",
                nullable: true,
                oldClrType: typeof(string),
                oldType: "character varying(256)",
                oldMaxLength: 256,
                oldNullable: true);

            migrationBuilder.AlterColumn<string>(
                name: "ConnectionId",
                table: "PTLogWarning",
                type: "character varying(64)",
                maxLength: 64,
                nullable: true,
                oldClrType: typeof(string),
                oldType: "character varying(32)",
                oldMaxLength: 32,
                oldNullable: true);

            migrationBuilder.AlterColumn<string>(
                name: "MessageTemplate",
                table: "PTLogInfo",
                type: "text",
                nullable: true,
                oldClrType: typeof(string),
                oldType: "character varying(256)",
                oldMaxLength: 256,
                oldNullable: true);

            migrationBuilder.AlterColumn<string>(
                name: "MessageTemplate",
                table: "PTLogException",
                type: "text",
                nullable: true,
                oldClrType: typeof(string),
                oldType: "character varying(256)",
                oldMaxLength: 256,
                oldNullable: true);

            migrationBuilder.AlterColumn<string>(
                name: "MessageTemplate",
                table: "PTLogError",
                type: "text",
                nullable: true,
                oldClrType: typeof(string),
                oldType: "character varying(256)",
                oldMaxLength: 256,
                oldNullable: true);
        }
    }
}
